layoutmanager demo: Make icons come out upright
authorMatthias Clasen <mclasen@redhat.com>
Fri, 4 Sep 2020 17:40:10 +0000 (13:40 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 4 Sep 2020 17:40:10 +0000 (13:40 -0400)
Rearrange the vertices so that the icons show
up in the proper orientation.

demos/gtk-demo/demo2layout.c

index fb0dc5a9f8bceac80fbccb0dbe8fac2a7c3b2aa1..ca5475d1a599f4278e48ec2232d1c4d575a89fc9 100644 (file)
@@ -106,10 +106,10 @@ demo2_layout_allocate (GtkLayoutManager *layout_manager,
 
       gtk_widget_set_child_visible (child, FALSE);
 
-      graphene_point3d_init (&p1, 0., 0., 1.);
+      graphene_point3d_init (&p1, w, h, 1.);
       graphene_point3d_init (&p2, w, 0., 1.);
-      graphene_point3d_init (&p3, 0., h, 1.);
-      graphene_point3d_init (&p4, w, h, 1.);
+      graphene_point3d_init (&p3, 0., 0., 1.);
+      graphene_point3d_init (&p4, 0., h, 1.);
 
       t_1 = RADIANS (map_offset (offset + 10 * j));
       t_2 = RADIANS (map_offset (offset + 10 * (j + 1)));
@@ -129,8 +129,8 @@ demo2_layout_allocate (GtkLayoutManager *layout_manager,
 
       graphene_point3d_init (&q1, x0 + SX (r, t_1, p_1), y0 + SY (r, t_1, p_1), SZ (r, t_1, p_1));
       graphene_point3d_init (&q2, x0 + SX (r, t_2, p_1), y0 + SY (r, t_2, p_1), SZ (r, t_2, p_1));
-      graphene_point3d_init (&q3, x0 + SX (r, t_1, p_2), y0 + SY (r, t_1, p_2), SZ (r, t_1, p_2));
-      graphene_point3d_init (&q4, x0 + SX (r, t_2, p_2), y0 + SY (r, t_2, p_2), SZ (r, t_2, p_2));
+      graphene_point3d_init (&q3, x0 + SX (r, t_2, p_2), y0 + SY (r, t_2, p_2), SZ (r, t_2, p_2));
+      graphene_point3d_init (&q4, x0 + SX (r, t_1, p_2), y0 + SY (r, t_1, p_2), SZ (r, t_1, p_2));
 
       /* Get a matrix that moves p1 -> q1, p2 -> q2, ... */
       perspective_3d (&p1, &p2, &p3, &p4,